CommandTranslate Class Reference

#include <CommandTranslate.h>

Inheritance diagram for CommandTranslate:

Command List of all members.

Public Member Functions

 CommandTranslate (TraffEduObject *obj, osg::Vec3 old_position, osg::Vec3 new_position, OSGWindows *osgwind)
bool execute ()
bool unexecute ()

Private Attributes

OSGWindows * osgwind_
vector< TraffEduObject * > translatedObjs_
osg::Vec3 old_position_
osg::Vec3 new_position_
TraffEduObject * obj_
int first_entrance

Constructor & Destructor Documentation

CommandTranslate::CommandTranslate (  TraffEduObject *  obj,
osg::Vec3  old_position,
osg::Vec3  new_position,
OSGWindows *  osgwind
) 
 

A constructor. Initializes osgwind_, old_position_, and new_position_ variables.

Parameters:
obj a TraffEduObject pointer.
old_position a osg::Vec3 variable.
new_position a osg::Vec3 variable.
osgwind an OSGWindows pointer.


Member Function Documentation

bool CommandTranslate::execute (   )  [virtual]
 

do the translation operation.

Returns:
Operation success

Implements Command.

bool CommandTranslate::unexecute (   )  [virtual]
 

undo the translation operation.

Returns:
Operation success

Implements Command.


Member Data Documentation

int CommandTranslate::first_entrance [private]
 

a private variable. It shows how many times is the execute function is called.

osg::Vec3 CommandTranslate::new_position_ [private]
 

a private variable. It is initialized with position of the object(s) after the translation operation.

TraffEduObject* CommandTranslate::obj_ [private]
 

a private variable. It is used to hold the translated object.

osg::Vec3 CommandTranslate::old_position_ [private]
 

a private variable. It is initialized with position of the object(s) before the translation operation.

OSGWindows* CommandTranslate::osgwind_ [private]
 

a private variable. It is initialized with the unique OSGWindows instance.

vector<TraffEduObject*> CommandTranslate::translatedObjs_ [private]
 

a private vector of TraffEduObjects. It holds the translated objects.


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:00 2006 by  doxygen 1.4.6-NO